package com.geticsen.leetcode;

//https://leetcode-cn.com/problems/flatten-binary-tree-to-linked-list/submissions/
public class Solution_114 {
    private TreeNode last;

    public void flatten(TreeNode root) {
        if (root == null) return;
        flatten(root.right);
        flatten(root.left);
        root.right = last;
        root.left = null;
        last = root;
    }
}
